/*
 * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package top.continew.admin.cakerun.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.continew.admin.cakerun.model.resp.GeneralCountResp;
import top.continew.admin.cakerun.model.resp.GeneralDailyResp;
import top.continew.admin.cakerun.model.resp.GeneralProjectResp;
import top.continew.starter.extension.datapermission.annotation.DataPermission;

import java.util.List;

@Mapper
public interface BoardMapper {
    @DataPermission(tableAlias = "ba", userId = "user_id")
    IPage<GeneralCountResp> generalCountPage(Page<GeneralCountResp> page,
                                             @Param("startTime") String startTime,
                                             @Param("endTime") String endTime,
                                             @Param("accountIds") List<Integer> accountIds);

    @DataPermission(tableAlias = "ba", userId = "user_id")
    IPage<GeneralDailyResp> generalDailyPage(Page<GeneralDailyResp> page,
                                             @Param("startTime") String startTime,
                                             @Param("endTime") String endTime,
                                             @Param("accountIds") List<Integer> accountIds);

    @DataPermission(tableAlias = "ba", userId = "user_id")
    List<GeneralCountResp> generalCount(@Param("startTime") String startTime,
                                        @Param("endTime") String endTime,
                                        @Param("accountIds") List<Integer> accountIds);

    @DataPermission(tableAlias = "ba", userId = "user_id")
    List<GeneralDailyResp> generalDaily(@Param("startTime") String startTime,
                                        @Param("endTime") String endTime,
                                        @Param("accountIds") List<Integer> accountIds);

    @DataPermission(tableAlias = "ba", userId = "user_id")
    List<GeneralProjectResp> generalProject(@Param("startTime") String startTime,
                                            @Param("endTime") String endTime,
                                            @Param("accountIds") List<Integer> accountIds);

    @DataPermission(tableAlias = "ba", userId = "user_id")
    IPage<GeneralProjectResp> generalProjectPage(Page<GeneralDailyResp> page,
                                                 @Param("startTime") String startTime,
                                                 @Param("endTime") String endTime,
                                                 @Param("accountIds") List<Integer> accountIds);

    @DataPermission(tableAlias = "ba", userId = "user_id")
    GeneralCountResp generalCountSummary(@Param("startTime") String startTime,
                                         @Param("endTime") String endTime,
                                         @Param("accountIds") List<Integer> accountIds);

    @DataPermission(tableAlias = "ba", userId = "user_id")
    GeneralProjectResp generalProjectSummary(@Param("startTime") String startTime,
                                             @Param("endTime") String endTime,
                                             @Param("accountIds") List<Integer> accountIds);

    @DataPermission(tableAlias = "ba", userId = "user_id")
    GeneralDailyResp generalDailyRespSummary(@Param("startTime") String startTime,
                                             @Param("endTime") String endTime,
                                             @Param("accountIds") List<Integer> accountIds);
}
